 /**
 * 逻辑、功能相关描述: <br>
 *
 * @author 付湘辉  <br>
 * 编写日期：2008-9-4  <br>
 */
package com.ce.pms.charge.vo;

import java.math.BigDecimal;
import java.math.MathContext;
import java.math.RoundingMode;

import com.ce.pms.common.model.SysrefcodeDO;

/**
 * 	名称: com.ce.pms.charge.vo.AdjustTransactionVO <br>
 *  调整交易VO,减免与之共用，是调整的一个特殊方式
 *
 * @author  付湘辉  <br>
 * Created on： 2008-9-4 <br>
 * @author <br>
 * update on： <br>
 * why: <br>
 */
public class AdjustTransactionVO extends DebitTransVO {
	/**
	 * long：serialVersionUID
	 */
	private static final long serialVersionUID = 1607397657668531950L;

	/**
	 * 交易名称
	 */
	private String transName;

	/**
	 * 已调整金额
	 */
	private BigDecimal haveAdjustPrice = new BigDecimal("0.00");

	/**
	 * 已减免金额
	 */
	private BigDecimal haveReliefPrice=new BigDecimal("0.00");

	/**
	 * 当前交易金额
	 */
	private BigDecimal curTransPrice=new BigDecimal("0.00");

	/**
	 * 调整(减免)后余额
	 */
	private BigDecimal reliefBalance=new BigDecimal("0.00");

	/**
	 * @return 已减免金额
	 */
	public BigDecimal getHaveReliefPrice() {
		return haveReliefPrice;
	}

	/**
	 * @param 已减免金额 to set
	 */
	public void setHaveReliefPrice(BigDecimal haveReliefPrice) {
		this.haveReliefPrice = haveReliefPrice;
	}

	/**
	 * @return the 减免后余额
	 */
	public BigDecimal getReliefBalance() {
		return reliefBalance;
	}

	/**
	 * @param 减免后余额 to set
	 */
	public void setReliefBalance(BigDecimal reliefBalance) {
		this.reliefBalance = reliefBalance;
	}

	/**
	 * @return the transName
	 */
	public String getTransName() {
		return transName;
	}

	/**
	 * @param transName the transName to set
	 */
	public void setTransName(String transName) {
		this.transName = transName;
	}

	/**
	 * 功能描述: 计算减免后的金额 <br>
	 *
	 *
	 * Create author:付湘辉 <br>
	 * Create on:2008-9-6  <br>
	 * Edit author:  <br>
	 * Edit on:    <br>
	 * Why:     <br>
	 */
	public void calculationReliefBalance(){
		this.reliefBalance = this.curTransPrice
		.subtract(this.getDebit().abs(),
		          new MathContext(SysrefcodeDO.DATA_PRICE_PRECISION, RoundingMode.HALF_UP));
	}

	/**
	 * 功能描述: 计算调整后的金额 <br>
	 *
	 *
	 * Create author:付湘辉 <br>
	 * Create on:2008-9-6  <br>
	 * Edit author:  <br>
	 * Edit on:    <br>
	 * Why:     <br>
	 */
	public void calculationAdjustBalance(){
		this.reliefBalance = this.curTransPrice
			.add(this.getDebit(),new MathContext(SysrefcodeDO.DATA_PRICE_PRECISION, RoundingMode.HALF_UP));
	}

	public BigDecimal getCurTransPrice() {
		return curTransPrice;
	}

	public void setCurTransPrice(BigDecimal curTransPrice) {
		this.curTransPrice = curTransPrice;
	}

	public BigDecimal getHaveAdjustPrice() {
		return haveAdjustPrice;
	}

	public void setHaveAdjustPrice(BigDecimal haveAdjustPrice) {
		this.haveAdjustPrice = haveAdjustPrice;
	}
}
